<?php /* Smarty version 2.6.13, created on 2008-11-21 08:20:56
         compiled from page_list.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'escape', 'page_list.tpl', 43, false),array('modifier', 'replace', 'page_list.tpl', 151, false),array('function', 'html_options', 'page_list.tpl', 48, false),)), $this); ?>
<table>
  <tr>
    <td id="leftpanel" valign="top">
        <div id="leftpaneldiv">
            <a href="javascript:void(0);" id="hidePanel"><img id="collapse" src="<?php echo $this->_tpl_vars['fvConfig']->get('dir_web_root'); ?>
img/collapse.gif" width="15" height="15"></a>
            <div class="header" id="leftPanelHeader">Список страниц</div>
            <div id="leftpaneldata">
                <?php $_from = $this->_tpl_vars['Pages']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['onePage']):
?>
                    <div style="float: right">
        <A 
           href="<?php echo $this->_tpl_vars['fvConfig']->get('dir_web_root'); ?>
pages/?id=<?php echo $this->_tpl_vars['onePage']->getPk(); ?>
" 
        onclick="go('<?php echo $this->_tpl_vars['fvConfig']->get('dir_web_root'); ?>
pages/?id=<?php echo $this->_tpl_vars['onePage']->getPk(); ?>
'); return false;"
        ><img src="<?php echo $this->_tpl_vars['fvConfig']->get('dir_web_root'); ?>
img/edit_icon.png" title="редактировать" width="16" height="16"></a><?php if ($this->_tpl_vars['onePage']->page_name != 'default'): ?><a
           href="javascript: void(0);" 
        onclick="if (confirm('Вы действительно желаете удалить страницу. Все дочерние страницы перенесутся в корень.')) go('<?php echo $this->_tpl_vars['fvConfig']->get('dir_web_root'); ?>
pages/delete/?id=<?php echo $this->_tpl_vars['onePage']->getPk(); ?>
'); return false;"
        ><img src="<?php echo $this->_tpl_vars['fvConfig']->get('dir_web_root'); ?>
img/delete_icon.png" title="удалить" width="16" height="16"></a><?php endif; ?>
                    </div><div><?php if ($this->_tpl_vars['onePage']->page_parent_id): ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php endif;  echo $this->_tpl_vars['onePage']->page_name; ?>
</div><div style="clear: both;">
                <?php endforeach; endif; unset($_from); ?>
            
                <div class="operation">
                    <a href="<?php echo $this->_tpl_vars['fvConfig']->get('dir_web_root'); ?>
pages/" onclick="go('<?php echo $this->_tpl_vars['fvConfig']->get('dir_web_root'); ?>
pages/'); return false;" class="add">добавить</a>
                </div>                
            </div>
        </div>
    </td>
    <td class="spacer">&nbsp;</td>
    <td id="datapanel">
<FORM method="post" action="/backend/pages/save/">
<div class="form">
    <H1><?php if ($this->_tpl_vars['Page']->isNew()): ?>Добавление страницы<?php else: ?>Редактирование страницы '<?php echo $this->_tpl_vars['Page']->page_name; ?>
'<?php endif; ?></H1>
    <?php if ($this->_tpl_vars['Page']->page_name == 'default'): ?>
    <p>Эта страница используется как базовая для задания основных параметров, таких как:</p>
    <ul class="num">
        <li>Основные мета-теги (если те не указаны в новых страницах.)</li>
        <li>Основные модули, которые будут присутствовать на новой странице</li>
    </ul>
    
    <?php else: ?>
    <fieldset>
        <legend>Общая информация</legend>
        <table class="form">
        <tr><td style="width: 1px;">
        <label for="page_name">Название</label></td><td> <input type="text" id="page_name" name="p[page_name]" value="<?php echo ((is_array($_tmp=$this->_tpl_vars['Page']->page_name)) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
"/>
        </td></tr><tr><td>
        <label for="page_url">Урл страницы</label></td><td><input type="text" id="page_url" name="p[page_url]" value="<?php echo ((is_array($_tmp=$this->_tpl_vars['Page']->page_url)) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
" /> <br />
        </td></tr><tr><td>
        <label for="page_parent_id">Родительская страница</label></td><td>
        <?php echo smarty_function_html_options(array('name' => "p[page_parent_id]",'id' => 'page_parent_id','options' => $this->_tpl_vars['PageManager']->htmlSelect('page_name',"","page_parent_id = 0 and page_name <> 'default' AND id <> ?",'','',$this->_tpl_vars['Page']->getPk()),'selected' => $this->_tpl_vars['Page']->page_parent_id), $this);?>

        </td></tr>
        </table>
    </fieldset>
    <?php endif; ?>

    <fieldset>
        <legend>Мета-информация</legend>
        <table class="form" id="metatags">
        <tr><td style="width: 1px;">
        <label for="page_title">Заголовок</label><br /><A href="javascript: void(0);" onclick="window.insertArea = 'page_title';">вставить тег</A>
            </td><td><textarea rows="2" id="page_title" name="p[page_title]" ><?php echo ((is_array($_tmp=$this->_tpl_vars['Page']->page_title)) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
</textarea><br/>
        </td></tr><tr><td>
        <label for="page_description">Описание</label><br /><A href="javascript: void(0);" onclick="window.insertArea = 'page_description';">вставить тег</A>
            </td><td><textarea rows="2" id="page_description" name="p[page_description]"><?php echo ((is_array($_tmp=$this->_tpl_vars['Page']->page_description)) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
</textarea><br />
        </td></tr><tr><td>
        <label for="page_keywords">Ключевые слова</label><br /><A href="javascript: void(0);" onclick="window.insertArea = 'page_keywords';">вставить тег</A>
            </td><td><textarea rows="2" id="page_keywords" name="p[page_keywords]"><?php echo ((is_array($_tmp=$this->_tpl_vars['Page']->page_keywords)) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
</textarea><br />
        </td></tr>
        </table>
    </fieldset>
    <div class="operation">
        <a href="javascript: void(0);" class="content_edit" id="content_edit"
            onclick=""
        >управление содержимым страницы</a>
        <br clear="all">
    </div>

    <div class="buttonpanel">
        <input type="submit" name="save" value="Сохранить" class="button">
    </div>
    <input type="hidden" name="id" id="id" value="<?php echo $this->_tpl_vars['Page']->getPk(); ?>
" />
    <input type="hidden" name="p[page_content]" id="page_content" value="<?php if (! $this->_tpl_vars['Page']->isNew()):  echo ((is_array($_tmp=$this->_tpl_vars['Page']->getPageContent())) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp));  endif; ?>" />
</div>
</FORM>
    </td>
  </tr>
</table>

<div style="display: none" id="headers_content">
    <div class="popup_content">
        <a href="javascript: void(0)">StaticPages_getTitle</a> - заголовок статической страницы
    </div>
</div>

<?php echo '
<script>
    Object.extend(window, {
        insertArea: \'\'
    });

    function moveLeftPanel (e) {
        if ($(\'leftpanel\').getDimensions().width > 100) {
            $(\'leftpanel\').morph(\'width: 20px;\');
            $(\'leftPanelHeader\').update("");
            $(\'leftpaneldata\').hide();
            $(\'collapse\').src = \'';  echo $this->_tpl_vars['fvConfig']->get('dir_web_root'); ?>
img/expand.gif<?php echo '\';
        } else {
            $(\'leftpanel\').morph(\'width: 300px;\');
            $(\'collapse\').src = \'';  echo $this->_tpl_vars['fvConfig']->get('dir_web_root'); ?>
img/collapse.gif<?php echo '\';
            setTimeout("$(\'leftPanelHeader\').update(\'Список страниц\')", 1000);
            setTimeout("$(\'leftpaneldata\').show()", 1000);
        }
    }
    
    var helpwindow = new PopUpWindow({
        width: 400,
        height: 300,
        center: true,
        title: "заголовки",
        name: \'headers\',
        buttons: [\'cancel\'],
        contentData: $(\'headers_content\').innerHTML,
        zIndex: 120
    });
    
    $$("table#metatags tr td a").each(function (link){
        link.observe("click", function (evt) {
            helpwindow.show();
        });
    })
    
    $$(\'div.popup_content a\').each(function (link) {
        link.observe(\'click\', function (evt) {
            elem = Event.element(evt);
            helpwindow.close();
            if ($(window.insertArea)) {
                $(window.insertArea).value = $F(window.insertArea) + \'%\' + elem.innerHTML + \'%\';     
            }   
        })
    });
    
    var wnd = new PopUpWindow({
        width: 800,
        height: 600,
        center: true,
        url: \'/backend/\',
        title: "управление содержимым",
        name: \'content_edit\',
        zIndex: 100,
        onShow: function (params) {
            new Ajax.Updater(\'content_edit_content\', \'';  echo $this->_tpl_vars['fvConfig']->get('dir_web_root'); ?>
pages/contentedit/<?php echo '\', {
                parameters: {
                    _xmlContent: $F("page_content") || \'';  echo ((is_array($_tmp=$this->_tpl_vars['Page']->getPageContent())) ? $this->_run_mod_handler('replace', true, $_tmp, "\n", "") : smarty_modifier_replace($_tmp, "\n", ""));  echo '\'.replace("&lt;?xml version=&quot;1.0&quot;?&gt;", "&lt;?xml version=&quot;1.0&quot;?&gt;\\n")
                },
                evalScripts: true
            });
        },
        onOk: function (params) {
            $(\'page_content\').value = $F(\'_xmlContent\');
        }
    });
    
    $(\'leftpaneldiv\').setStyle({
        height: (document.viewport.getHeight() - $(\'header\').getDimensions().height - 25) + "px"
    });
    
    $(\'hidePanel\').observe(\'click\', moveLeftPanel);
    $(\'content_edit\').observe(\'click\', wnd.show.bind(wnd));
</script>
'; ?>